package com.doit.day06

object _07_继承 {
  def main(args: Array[String]): Unit = {
    val zss: Fu = new Fu(1, "zss")
    zss.fish()
    zss.playCards()


/*    val zi: Zi = new Zi("思聪", 10000)
    println(zi.name)//  思聪
    println(zi.id)//1
    zi.fish()
    zi.playCards()
    zi.playGames()
    println(zi.money)*/


    val sicong: Fu = new Zi(1, "sicong", 1000)



  }

}


class Ye

class Sun extends Zi(1,"zss",100)

class Fu(val id:Int,val name:String) extends Ye {
  def fish()={
    println("我会钓鱼")
  }
  def playCards()={
    println("我会打牌")
  }
}

/*class Zi(override val name :String, val money:Double) extends Fu(1,"马爸爸"){
  def playGames()={
    println("我喜欢打游戏")
  }
}*/

class Zi(id:Int,name :String,val money:Double) extends Fu(id, name){
  def playGames()={
    println("我喜欢打游戏")
  }
}